#!/bin/bash
source k8s_install/config/installer.conf #读取安装信息
f="请先使用下面的命令配置安装信息
vi k8s_install/config/installer.conf"
chek_info(){
	if [[ "$config" == "yes" || "$config" == "Yes" || "$config" == "YES" ]];then
		echo '你已配置安装信息'
	else
		echo $f
		a=1
	fi
	if [[ "$Host_type" == "Master" || "$Host_type" == "master" || "$Host_type" == "MASTER" ]];then
		h="节点类型为:	Master"
	elif [[ "$Host_type" == "Node" || "$Host_type" == "node" || "$Host_type" == "NODE" ]];then
		h="节点类型为:	Node"
	else
		h="请检查主机类型信息"
		a=1
	fi
	if [[ "$System_Update" == "yes" ]];then
		Systems="系统更新:	Yes"
	elif [[ "$System_Update" == "no" ]];then
		Systems="系统更新:	No"
	else
		echo '请检查系统更新选项参数'
		a=1
	fi
	if [[ "$Config_Sources" == "yes" || "$Config_Sources" == "Yes" || "$Config_Sources" == "YES" ]];then
		Configs="配置系统源:	是"
	elif [[ "$Config_Sources" == "no" || "$Config_Sources" == "No" || "$Config_Sources" == "NO" ]];then
		Configs="配置系统源:    否"
	else
		echo '请检查配置源参数'
		a=1
	fi
}
chek_info
echo -e "服务安装配置信息如下:\n${h}\n${Systems}\n${Configs}"
if [[ "$a" == "1" ]];then
	echo $f	
	exit 0
fi
echo '测试'
